home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / fscheck / RCS / fscheck.man,v < prev    next >
Encoding:
Text File  |  1990-02-15  |  18.2 KB  |  565 lines

  1. head     1.6;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.6
  10. date     89.08.25.22.24.31;  author jhh;  state Exp;
  11. branches ;
  12. next     1.5;
  13.  
  14. 1.5
  15. date     89.06.21.23.56.10;  author jhh;  state Exp;
  16. branches ;
  17. next     1.4;
  18.  
  19. 1.4
  20. date     89.02.28.12.22.40;  author jhh;  state Exp;
  21. branches ;
  22. next     1.3;
  23.  
  24. 1.3
  25. date     88.12.30.09.26.56;  author ouster;  state Exp;
  26. branches ;
  27. next     1.2;
  28.  
  29. 1.2
  30. date     88.12.21.11.51.17;  author ouster;  state Exp;
  31. branches ;
  32. next     1.1;
  33.  
  34. 1.1
  35. date     88.12.21.11.10.02;  author ouster;  state Exp;
  36. branches ;
  37. next     ;
  38.  
  39.  
  40. desc
  41. @@
  42.  
  43.  
  44. 1.6
  45. log
  46. @Added ability to modify host id in domain header.
  47. @
  48. text
  49. @' $Header: /a/newcmds/fscheck/RCS/fscheck.man,v 1.5 89/06/21 23:56:10 jhh Exp Locker: jhh $ SPRITE (Berkeley)
  50. .so \*(]ltmac.sprite
  51. .HS FSCHECK cmds
  52. .BS
  53. .SH NAME
  54. fscheck \- perform consistency check on file system
  55. .SH SYNOPSIS
  56. \fBfscheck -dev \fIdevice\fP -part \fIpartition\fP [\fIoptions\fR]
  57. .SH OPTIONS
  58. .IP "\fB\-dev\fI device\fR" 14
  59. \fIDevice\fP is the root name of a device, i.e. rxy0, rsd1, rsb0
  60. .IP "\fB\-part\fI partition\fR" 14
  61. \fIPartition\fP is a letter indicating a partition, i.e. a, b, c, d, e, f, g.
  62. .IP "\fB\-dir\fI devDir\fR" 14
  63. \fIDevDir\fR is an alternate directory in which to find the device file
  64. named by concatenating \fIDevice\fR and \fIPartition\fR.  The default 
  65. directory name is ``/dev/``.
  66. .IP "\fB\-initialPart\fI firstPartName\fR" 14
  67. \fIfirstPartName\fP is the name of the initial partition on the disk
  68. which contains basic disk geometry information.  The default is partition
  69. ``a''.
  70. .IP "\fB\-write\fR" 14
  71. Write the disk when errors are encountered and fixed.  The default is to
  72. not write the disk.
  73. .IP "\fB\-silent\fR" 14
  74. Don't say anything unless there is an error.
  75. .IP "\fB\-verbose\fR" 14
  76. Output verbose information about errors.  The default is to print out
  77. terse information.
  78. .IP "\fB\-incVersion\fR" 14
  79. If the domain was not written back properly on system shutdown then all
  80. version numbers will be incremented.
  81. .IP "\fB\-fixRoot\fR" 14
  82. Re-create a missing or corrupted root directory.
  83. .IP "\fB\-clear\fR" 14
  84. Clear the domain number field stored in the summary sector.
  85. .IP "\fB\-hostID\fI id\fR" 14
  86. Update the host ID in the disk header. If \fIid\fR is not 0 then it is used
  87. as the host id to put in the header. If \fIid\fR equals 0 then one of two
  88. values are used as the host id.  If the device server is the local host
  89. then the kernel's internal idea of its host id is used, otherwise the
  90. device server's id is used.
  91. .IP "\fB\-badBlock\fR" 14
  92. Initialize the bad block file descriptor.
  93. .IP "\fB\-outputFile\fI outputFile\fR" 14
  94. All output to stdout and stderr is also appended to 
  95. \fIoutputFile\fR. 
  96. .IP "\fB\-bufferSize\fI size\fR" 14
  97. Set the size of the buffer associated with \fIoutputFile\fR to \fIsize\fR bytes.
  98. Default is to use whatever buffer is provided by the stdio library.
  99. This option has no effect if the \fB\-outputFile\fR option is not used.
  100. .IP "\fB\-rootPart\fR" 14
  101. This option controls the output to a file. If the \fB\-outputFile\fR option
  102. is not given then this option has no effect. 
  103. Otherwise, the output is stored in a buffer and only written to the
  104. file when the program exits.
  105. This allows the output to be written to a file on the partition being checked
  106. (usually the output is written to the root partition).
  107. The file IO in this case is very primative and restrictive. The output file
  108. must be in the root directory and must exist prior to running \fBfscheck\fR.
  109. If the size of the output exceeds the size of the file or if it exceeds the
  110. size of the direct data blocks then it will be truncated. If the output
  111. exceeds the size of the internal buffer it will be truncated
  112. (see \fB\-bufferSize\fR ).
  113. If the output is smaller than the size of the file, the remaining part of
  114. the file will be filled with null characters.
  115. Any file produced by this option will have a decimal number in the first
  116. line which represents the number of bytes in the file. This is used by
  117. \fBfscheck\fR to calculate the starting point for appending.
  118. The output file can be reset by either setting the first number to 0 or by
  119. overwriting the file with null characters.
  120. .IP "\fB\-heapLimit\fI size\fR" 14
  121. Program will not allocate more than \fIsize\fR bytes of memory. Default is to 
  122. allocate as much as is needed.
  123. .IP "\fB\-delete\fR" 14
  124. If a data block is shared by more than one file, delete it from all but one
  125. of the files. The default is to make a copy of the block for each file
  126. sharing the original.
  127. .IP "\fB\-readBlock\fI count\fR" 14
  128. Read count blocks at a time when reading the file descriptors. 
  129. Currently this does not provide better performance due to limitations in the
  130. disk interface library.
  131. .IP "\fB\-debug\fR" 14
  132. Print out debugging information.
  133. .IP "\fB\-bitmapVerbose\fR" 14
  134. Print out lots and lots of information about errors in the bitmaps.
  135. .IP "\fB\-numReboot\fI count\fR" 14
  136. Number of consecutive times to reboot before returning a warning indication.
  137. .IP "\fB\-clearFixCount\fR" 14
  138. Clear consecutive fix counter.
  139. .BE
  140.  
  141. .SH DESCRIPTION
  142. .LP
  143. This program will perform a consistency check on a file system.  By default
  144. it will report inconsistencies but won't repair them.  If the \fB\-write\fP 
  145. option
  146. is used then it will repair any inconsistencies by modifying the disk as
  147. necessary.
  148. .LP
  149. This program performs the following consistency checks:
  150. .IP 1. 5
  151. It makes sure that the file descriptor allocation bit map agrees with the
  152. status information kept in each file descriptor.  If necessary it will correct
  153. the bit map.
  154. .IP 2. 5
  155. It confirms that data-block and indirect-block pointers are valid.  If a 
  156. pointer is invalid then the pointer is set to NIL and the file size is
  157. adjusted as necessary to reflect the new size of the file.
  158. .IP 3. 5
  159. It recreates the data block allocation bit map based on information in
  160. the file descriptors and indirect blocks.
  161. .IP 4. 5
  162. It checks for blocks that are allocated to more than one file.  
  163. If a block is multiply allocated then copies of the block are made and 
  164. all but one of 
  165. the files is corrected to use a copy.
  166. If the \fB\-delete\fR option is given, or if only a subset of the fragments in
  167. a block are shared, then the block is given to the 
  168. lowest numbered file
  169. descriptor and it is removed from all other files that reference it.
  170. A special case is made of block 0. This block belongs to the root directory
  171. and is copied (or deleted) for all other files even if the root directory
  172. is corrupted or doesn't exist.
  173. .IP 5. 5
  174. It verifies that directories are of the proper format.  In order to patch
  175. a directory, names may be deleted, the directory may be truncated,
  176. or in the worst case the directory may be turned into a normal file.
  177. .IP 6. 5
  178. It puts unreferenced files into the lost+found directory.  The name of each
  179. file in the lost+found directory is the file's file descriptor number.
  180. .IP 7. 5
  181. It corrects link counts and block counts in each file descriptor.
  182. .IP 8. 5
  183. It checks that indirect blocks contain valid pointers. If the pointers are
  184. invalid and the block is part of a file then a hole is created, 
  185. otherwise if the
  186. block is part of a directory then the directory is truncated.
  187. .IP 9. 5
  188. It checks that each file descriptor contains a valid magic number. If this is
  189. not the case then the file descriptor is cleared and marked as unused in the
  190. bitmap.
  191. .IP 10. 5
  192. It recreates the root directory if it is corrupted and the \fB\-fixRoot\fR
  193. option is given.
  194. .LP
  195. By default only terse information is given about the errors in the file system.
  196. Only the first error per file is reported.
  197. If the \fB\-verbose\fP 
  198. option is given then more verbose information will be given.
  199. If the \fB\-bitmapVerbose\fR option is given then differences between the
  200. bitmaps on disk and the recreated bitmaps are printed. Since the bitmaps
  201. on disk are not kept current use of this option is likely to produce 
  202. lots of output.
  203. .LP
  204. The \fBfscheck\fP program will also perform other actions depending on
  205. the options that are specified.  If the \fB\-incVersion\fP 
  206. option is given then flags
  207. in the file system header are checked to see if the file system
  208. was safely written back
  209. when it was detached or the system went down.  If it is determined that the
  210. file system was not safely written back then the version numbers for
  211. all files in the file system are incremented.  This will cause all
  212. reopens of files because of recovery to fail.
  213. .LP
  214. If the \fB\-fixRoot\fP option is given the root directory will
  215. be recreated if it has become corrupted.  If the root is recreated, then
  216. any directories that have the root directory as their parent
  217. will be inserted into the root with their file descriptor number
  218. as their name.
  219. Any files that used to be in the root directory will be placed in lost+found.
  220. \fBFscheck\fR assumes that data block 0 belongs to the root directory and
  221. will allocate this block to the directory when reconstructing it.
  222. The \fB\-fixRoot\fR option requires reading the root directory twice, hence
  223. it cannot be used without the \fB\-write\fR option.
  224. .LP
  225. The \fB\-clear\fP option should be used if the domain number field should be
  226. cleared from the summary sector.  Each file system that is attached is
  227. given a domain number under which it can be identified.
  228. When a file system is attached, the system will try to attach it with the same
  229. domain number that it was attached under last time.  This
  230. is required to allow clients of the file system to recover when the file
  231. system is reattached.  If the domain number field is cleared from the
  232. summary sector, then the system will attach the file system under a domain
  233. number of the system's choosing.
  234. .LP 
  235. The \fB\-hostID\fP option will force the system to update the host id in the
  236. file system header.  If the device under which the file system is being
  237. attached is generic then the id of the host on which \fBfscheck\fP is run is
  238. used.  Otherwise the host id specified by the device file is used.
  239. The default is not to modify the host id.
  240. .LP
  241. The \fB\-badBlock\fP 
  242. option will initialize the file descriptor which points
  243. to bad disk blocks.  Initializing it will clear out any pointers to bad
  244. blocks that are currently in the file descriptor.
  245. .LP
  246. The \fB\-heapLimit\fR option can be used to place an upper limit on the 
  247. size of the program heap. This can be used to prevent paging, since paging
  248. cannot be done at the point in the boot sequence when \fBfscheck\fR is run.
  249. If \fBfscheck\fR cannot 
  250. complete checking the disk because of the limit then it will
  251. do as much as it can. 
  252. This should allow multiple runs of \fBfscheck\fR to completely check the disk.
  253. The limit is only an approximation of how large \fBfscheck\fR will grow, since 
  254. the program stack is not restricted. Therefore the limit should be set as
  255. high as possible but it should not be set to the boundary at which
  256. paging will occur. 
  257. If it is set too small then \fBfscheck\fR may not be 
  258. able to run
  259. at all. Note that the \fBbufferSize\fR and \fBreadBlock\fR
  260. options will affect the amount of heap required.
  261. As a rule of thumb, the amount of heap space needed by \fBfscheck\fR 
  262. is proportional
  263. to the disk size and the amount of errors on the disk. 
  264. A heap limit of 1 Mb should be sufficient for all but the most extreme cases.
  265. .LP
  266. Each time \fBfscheck\fR runs and finds an error in a partition, a 
  267. counter on disk
  268. is incremented. The value of this counter is the number of consecutive
  269. times \fBfscheck\fR has run on the partition and corrected an error. 
  270. If the counter
  271. exceeds the value given by the \fB\-numReboot\fR option (default 4) and
  272. if \fBfscheck\fR corrects an error, then \fBfscheck\fR will return 
  273. EXIT_NOREBOOT
  274. instead of the standard soft error indication.
  275. This allows higher level software to avoid infinite reboot loops.
  276. .LP
  277. The \fB\-clearFixCount\fR option resets the consecutive counter to 0.
  278. .LP
  279. Finally, the \fB\-output\fR, \fB\-bufferSize\fR and \fB\-noFlush\fR options 
  280. control the output from fscheck. The \fB\-output\fR option
  281. allows the output from fscheck
  282. to be put into a file as well as printed on stdout and stderr.
  283. The \fB\-bufferSize\fR option sets the size of the IO buffer associated with 
  284. the output file.
  285. The \fB\-noFlush\fR option prevents the buffer from being flushed until the
  286. disk has been checked and corrected. 
  287. This allows the output to be written to the disk being checked.
  288. If the output exceeds the size of the buffer then it is truncated to the
  289. buffer size.
  290. If the buffer size is exceeded in the middle of an output string, then remainder
  291. of the string will wrap over the beginning of the buffer. 
  292. .SH EXIT CODES
  293. .LP 
  294. \fBFscheck\fR has a large number of exit codes. 
  295. Positive values indicate that some sort of error occurred that requires 
  296. \fBfscheck\fR be run again, although an exit code of 1 indicates that the
  297. filesystem was corrupted but was successfully corrected.
  298. Negative error codes indicate that a serious error occurred that requires
  299. user action before fscheck can be run again.
  300. .IP 0 5
  301. No errors occurred and no errors were fixed in the filesystem.
  302. .IP 1 5
  303. Errors were fixed in the filesystem.
  304. .IP 2 5
  305. \fBFscheck\fR ran out of memory before it was able to completely check the
  306. disk. Rerunning with the same heap limit should allow \fBfscheck\fR to finish.
  307. .IP 3 5
  308. Errors were fixed in the filesystem and the number of consecutive times
  309. \fBfscheck\fR has fixed this partition exceeds the limit.
  310. .IP -1 5
  311. An unspecified hard error occurred.
  312. .IP -2 5
  313. A disk read failed.
  314. .IP -3 5
  315. A disk write failed.
  316. .IP -4 5
  317. There was a problem with one of the arguments.
  318. .IP -5 5
  319. The heap limit is too small for \fBfscheck\fR to run. The heap limit must be
  320. made larger before rerunning \fBfscheck\fR.
  321. .IP -6 5
  322. The disk is full so that duplicate blocks cannot be copied. Either delete some
  323. stuff or rerun using the \fB\-delete\fR option.
  324. .LP 
  325. .SH BUGS/FEATURES
  326. .LP
  327. Indirect blocks are always marked as in use in the bitmap, even if they contain
  328. invalid entries. This is because the block may be in use by another file and
  329. cannot be marked as free.
  330. .LP
  331. The \fB\-fixRoot\fR option cannot be used without the \fB\-write\fR option.
  332. .SH KEYWORDS
  333. file system, disk
  334. @
  335.  
  336.  
  337. 1.5
  338. log
  339. @Various bug fixes
  340. @
  341. text
  342. @d1 1
  343. a1 1
  344. ' $Header: /a/newcmds/fscheck/RCS/fscheck.man,v 1.4 89/02/28 12:22:40 jhh Exp $ SPRITE (Berkeley)
  345. d37 6
  346. a42 2
  347. .IP "\fB\-hostID\fR" 14
  348. Update the host ID in the disk header.
  349. d187 1
  350. a187 1
  351. The \fB\-hostID\fP option will force the system to update the host ID in the
  352. d189 3
  353. a191 2
  354. attached is generic then the ID of the host on which \fBfscheck\fP is run is
  355. used.  Otherwise the host ID specified by the device file is used.
  356. @
  357.  
  358.  
  359. 1.4
  360. log
  361. @Converted to new C library, added lots of new functionality
  362. @
  363. text
  364. @d1 1
  365. a1 1
  366. ' $Header: /a/newcmds/fscheck/RCS/fscheck.man,v 1.3 88/12/30 09:26:56 ouster Exp Locker: jhh $ SPRITE (Berkeley)
  367. d81 6
  368. d144 1
  369. d147 4
  370. a150 6
  371. For example, by default, differences between the data block allocation bitmap
  372. that is stored on disk and the one that is recreated by scanning the file
  373. descriptors are not reported; only a single line of information will be
  374. printed out if the two versions of the bit map are not identical.
  375. However, if the \fB\-verbose\fP is given then
  376. all differences are printed out.
  377. d213 13
  378. d254 3
  379. d264 1
  380. a264 1
  381. There was a problem with one of the arguements.
  382. a278 4
  383. .LP
  384. If \fBfscheck\fR needs
  385. free disk space to copy a shared block or fragment it will
  386. look for an entire free block.
  387. @
  388.  
  389.  
  390. 1.3
  391. log
  392. @More format upgrades.
  393. @
  394. text
  395. @d1 1
  396. a1 1
  397. ' $Header: /a/newcmds/fscheck/RCS/fscheck.man,v 1.2 88/12/21 11:51:17 ouster Exp $ SPRITE (Berkeley)
  398. d8 1
  399. a8 3
  400. \fBfscheck -D \fIdevice\fP -P \fIpartition\fP [-d \fIdevDir\fP]
  401. .br
  402. \fBfscheck -p \fIfirstPartName\fP -WSVrRcHb
  403. d10 1
  404. a10 1
  405. .IP "\fB\-D\fI device\fR" 14
  406. d12 1
  407. a12 1
  408. .IP "\fB\-P\fI partition\fR" 14
  409. d14 3
  410. a16 3
  411. .IP "\fB\-d\fI devDir\fR" 14
  412. \fIDevDir\fP is an alternate directory in which to find the device file
  413. named by concatenating \fIDevice\fP and \fIPartition\fP.  The default is
  414. d18 1
  415. a18 1
  416. .IP "\fB\-p\fI firstPartName\fR" 14
  417. d22 1
  418. a22 1
  419. .IP "\fB\-W\fI" 14
  420. d25 1
  421. a25 1
  422. .IP "\fB\-S\fI" 14
  423. d27 1
  424. a27 1
  425. .IP "\fB\-V\fI" 14
  426. d30 1
  427. a30 1
  428. .IP "\fB\-r\fI" 14
  429. d33 1
  430. a33 1
  431. .IP "\fB\-R\fI" 14
  432. d35 1
  433. a35 1
  434. .IP "\fB\-c\fI" 14
  435. d37 1
  436. a37 1
  437. .IP "\fB\-H\fI" 14
  438. d39 1
  439. a39 1
  440. .IP "\fB\-b\fI" 14
  441. d41 40
  442. d86 2
  443. a87 1
  444. it will report inconsistencies but won't repair them.  If the \fB\-W\fP option
  445. d97 1
  446. a97 1
  447. It validates that data-block and indirect-block pointers are valid.  If a 
  448. d104 7
  449. a110 2
  450. It checks for blocks that are allocated to more than one file.  If a block
  451. is doubly allocated, the block is given to the lowest numbered file
  452. d112 3
  453. d124 12
  454. d138 2
  455. a139 1
  456. If the \fB\-V\fP option is given then more verbose information will be given.
  457. d144 1
  458. a144 1
  459. However, if the \fB\-V\P is given then
  460. d148 2
  461. a149 1
  462. the options that are specified.  If the \fB\-r\fP option is given then flags
  463. d157 3
  464. a159 3
  465. The \fB\-R\fP option should be specified if the root directory should
  466. be recreated if it has become corrupted.  It the root is recreated, then
  467. any files that used to have the root directory as their parent
  468. d162 5
  469. d168 1
  470. a168 1
  471. The \fB\-c\fP option should be used if the domain number field should be
  472. d178 1
  473. a178 1
  474. The \fB\-H\fP option will force the system to update the host ID in the
  475. d183 2
  476. a184 1
  477. Finally, the \fB\-b\fP option will initialize the file descriptor which points
  478. d187 75
  479. a261 1
  480.  
  481. @
  482.  
  483.  
  484. 1.2
  485. log
  486. @Editorial cleanup.
  487. @
  488. text
  489. @d1 1
  490. a1 1
  491. ' $Header: /a/newcmds/fscheck/RCS/fscheck.man,v 1.1 88/12/21 11:10:02 ouster Exp $ SPRITE (Berkeley)
  492. d12 1
  493. a12 1
  494. .IP "\fB-D\fI device\fR" 14
  495. d14 1
  496. a14 1
  497. .IP "\fB-P\fI partition\fR" 14
  498. d16 1
  499. a16 1
  500. .IP "\fB-d\fI devDir\fR" 14
  501. d20 1
  502. a20 1
  503. .IP "\fB-p\fI firstPartName\fR" 14
  504. d24 1
  505. a24 1
  506. .IP "\fB-W\fI" 14
  507. d27 1
  508. a27 1
  509. .IP "\fB-S\fI" 14
  510. d29 1
  511. a29 1
  512. .IP "\fB-V\fI" 14
  513. d32 1
  514. a32 1
  515. .IP "\fB-r\fI" 14
  516. d35 1
  517. a35 1
  518. .IP "\fB-R\fI" 14
  519. d37 1
  520. a37 1
  521. .IP "\fB-c\fI" 14
  522. d39 1
  523. a39 1
  524. .IP "\fB-H\fI" 14
  525. d41 1
  526. a41 1
  527. .IP "\fB-b\fI" 14
  528. d48 1
  529. a48 1
  530. it will report inconsistencies but won't repair them.  If the \fB-W\fP option
  531. d79 1
  532. a79 1
  533. If the \fB-V\fP option is given then more verbose information will be given.
  534. d84 1
  535. a84 1
  536. However, if the \fB-V\P is given then
  537. d88 1
  538. a88 1
  539. the options that are specified.  If the \fB-r\fP option is given then flags
  540. d96 1
  541. a96 1
  542. The \fB-R\fP option should be specified if the root directory should
  543. d102 1
  544. a102 1
  545. The \fB-c\fP option should be used if the domain number field should be
  546. d112 1
  547. a112 1
  548. The \fB-H\fP option will force the system to update the host ID in the
  549. d117 1
  550. a117 1
  551. Finally, the \fB-b\fP option will initialize the file descriptor which points
  552. @
  553.  
  554.  
  555. 1.1
  556. log
  557. @Initial revision
  558. @
  559. text
  560. @d1 1
  561. a1 1
  562. ' $Header: /sprite/doc/ref/cmds/RCS/fscheck,v 1.2 88/10/31 13:14:21 brent Exp $ SPRITE (Berkeley)
  563. d9 1
  564. @
  565.